/*
 * Copyright 2012 Alain Pannetrat (L1L1@gmx.com)
 * 
 * This file is part of cookie-miner.
 * 
 * cookie-miner is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 * 
 * cookie-miner is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with cookie-miner. If not, see http://www.gnu.org/licenses/.
 *
 * @version: $Id$
 *
 */
#include "dictionary.h"

/* here be dragons */

#ifdef _TEST_DICTIONARY_H_
#include <cstdio>
int main()
{
	Dictionary<unsigned> dict;
	char buf[10];
	Dictionary<unsigned>::Iterator it;
	
	fprintf(stderr,"sizeof(Dictionary<unsigned>)=%u\n",
		sizeof(dict));
	fprintf(stderr,"sizeof(DictionaryItem<unsigned>)=%u\n",
		sizeof(Dictionary<unsigned>::Item));
	fprintf(stderr,"Start\n");fflush(stderr);
	for (unsigned u=0;u<20;u++)
	{
		sprintf(buf,"%c%c%c",u+'a','z'-u,u+'a');
		dict.set(buf,u);
	}
	dict.set("n16",255);
	dict.dump();

	for (it=dict.begin();it!=dict.end();++it)
	{
		fprintf(stderr,"(%s,%u)\n",it.get().key().c_str(),it.get().val());
	}
	fprintf(stderr,"Done\n");fflush(stderr);
	
}
#endif
